-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified the trustymail code to handle SPF redirects #29
Conversation
domain.syntax_errors.append(error.msg) | ||
|
||
|
||
def get_spf_record_text(resolver, domain_name, domain, follow_redirect=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should follow_redirect
default to True?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments below, in the spf_scan
function.
""" | ||
# If an SPF record exists, record the raw SPF record text in the | ||
# Domain object | ||
record_text_not_following_redirect = get_spf_record_text(resolver, domain.domain_name, domain) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_spf_record_text
is called with follow_redirect=False
here because we want the SPF record that directly corresponds to domain.domain_name
. We stash this value inside of domain.spf
on line 291.
if record_text_not_following_redirect: | ||
domain.spf.append(record_text_not_following_redirect) | ||
|
||
record_text_following_redirect = get_spf_record_text(resolver, domain.domain_name, domain, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_spf_record_text
is called with follow_redirect=True
here because we want to follow the redirects until we get an SPF record that we can use to determine the expected behavior when we run spf.check()
inside of the check_spf_record
function on line 198.
👍 🇺🇸 |
…m-forked-repos Make workflow run when a PR is opened, synchronized, or reopened
This looks like a bigger change than it is because I:
spf_scan()
function up into three separate functionsThis will resolve #7.